#!/bin/bash

. /etc/rc.d/functions

AYGUCI_PATH="/usr/milis/ayguci"
BIN_FILE="${AYGUCI_PATH}/server/ayguci-server"
LOG_FILE="/tmp/ayguci.log"

case "$1" in
   start)
      log_info_msg "Starting Ayguci daemon..."
      ${BIN_FILE} 2>&1 >/dev/null &
      evaluate_retval
      ;;

   stop)
      log_info_msg "Stopping Ayguci daemon..."
      killproc ${BIN_FILE}
      evaluate_retval
      ;;

   restart)
      $0 stop
      sleep 1
      $0 start
      ;;

   status)
      statusproc ${BIN_FILE}
      ;;

   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End /etc/init.d/crond
